home *** CD-ROM | disk | FTP | other *** search
- /* $VER: WBStars_libraries.c 2.0b4 (29 May 1997)
- */
-
- #include <proto/exec.h>
-
- #include "WBStars_include.h"
- #include "WBStars_protos.h"
-
- struct IntuitionBase *IntuitionBase=NULL;
- struct GfxBase *GfxBase=NULL;
- struct Library *CxBase=NULL;
- struct Library *IconBase=NULL;
- struct Library *LayersBase=NULL;
- char OS3=FALSE;
-
- char OpenLibraries() /* opens all needed libraries */
- { /* returns TRUE on success */
- IntuitionBase =(struct IntuitionBase*)OpenLibrary("intuition.library",0L);
- CxBase =OpenLibrary("commodities.library",37L);
- IconBase =OpenLibrary("icon.library",36L);
- LayersBase =OpenLibrary("layers.library",0L);
- if(GfxBase =(struct GfxBase*)OpenLibrary("graphics.library",39L))
- {OS3=TRUE;}else
- {GfxBase=(struct GfxBase*)OpenLibrary("graphics.library",0L);}
-
- if( !IntuitionBase || !GfxBase || !CxBase || !IconBase || !LayersBase )
- {
- return FALSE;
- }
- return TRUE;
- }
-
- void CloseLibraries() /* closes all opened libraries */
- {
- if(IntuitionBase) CloseLibrary((struct Library*)IntuitionBase);
- if(GfxBase) CloseLibrary((struct Library*)GfxBase);
- if(CxBase) CloseLibrary(CxBase);
- if(IconBase) CloseLibrary(IconBase);
- if(LayersBase) CloseLibrary(LayersBase);
- }